#!/usr/bin/python3
# coding=utf-8

# -----------------------------------
# Author: bobo
# Date:
# -----------------------------------
"""docker-save.
Usage:
    docker-save.py -s <src>... -d <ext>
    docker-save.py bak [--bakdir=<path>]
    docker-save.py bak [--bakdir=<path>] (-c | --cover)
    docker-save.py load <image>
    docker-save.py (-h | --help)
    docker-save.py --version

Options:
    -h --help   Show info.
    -c --cover  Cover exist bak file.
    --version  Show version.
    --bakdir=<path>  Backup path.
    -s  src
    -d  exxx
"""

import mistune
from mistune.directives import Admonition, TableOfContents
from mistune.directives import FencedDirective
from utils.MistuneExtension import hedgeAlert
from utils import log
import logging

log.set_level(logging.DEBUG)

logger = log.get_logger("main")
# log.add_file_handler(logger)

md = mistune.create_markdown(
    escape=False,
    plugins=[
        "math",
        "footnotes",
        "strikethrough",
        hedgeAlert,
        FencedDirective(
            [
                Admonition(),
                TableOfContents(),
            ]
        ),
    ],
)


def test_markdown():
    from utils.MarkdownRender import render_markdown2

    txt = """> https://www.jb51.net/server/319801u4q.htm

[Toc]

$$
f(a)=f(b)
f(a)=f(b)
$$

```{toc}
```
:::primary 警告

**警告信息**
~~删除~~
:::

# h1
## h2

```{warning}

You are looking at the **dev** documentation. Check out our
[stable](/stable/) documentation instead.
```

**注意**，*这是一个演示效果*，~~我是被删除的内容~~
"""
    html = render_markdown2(txt)
    print(html)
    print("-" * 50)

    html = md(txt)
    print(html)


if __name__ == "__main__":
    # print(__doc__)
    # arguments = docopt(__doc__, version='docker-save 1.0')
    # print(arguments)
    test_markdown()
